﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using FeedAntGame.Sprite;
using FeedAntGame.Sprite.Event;
using Microsoft.Xna.Framework.Graphics;
using FeedAntGame.Sprite.Combo;

namespace FeedAntGame.Control
{
    class Battery : BaseControl
    {
        public enum TYPE { NORMAL }
        TYPE type;

        
        /************************************************************************/
        /*                  GET/SET                                                                     */
        /************************************************************************/
        /// <summary>
        /// should use EditTextSprite
        /// </summary>
        internal override BaseSprite Sprite
        {
            get { return sprite; }
        }
        internal TYPE Type
        {
            get { return type; }
            set 
            { 
                type = value;
                createInstance(sprite.Position);
            }
        }

        
        /************************************************************************/
        /*                  Constructor                                                                     */
        /************************************************************************/
        public Battery(Game game, TYPE type, Vector2 position)
            :base(game)
        {
            this.type = type;
            createInstance(position);
        }

        protected override void createInstance(Vector2 position)
        {
            switch (type)
            {     
                case TYPE.NORMAL:
                    BatteryPower bot = new BatteryPower(game, BatteryPower.TYPE.BOT, position + new Vector2(2,124));
                    BatteryPower body = new BatteryPower(game, BatteryPower.TYPE.BODY, Vector2.Zero);
                    BatteryPower top = new BatteryPower(game, BatteryPower.TYPE.TOP, Vector2.Zero);                    
                    body.Sprite.setEdgeScale(1,1);
                    top.Sprite.setEdgeScale(1, 1);
                    bot.Sprite.setEdgeScale(1, 1);
                    sprite = new BatterySprite(Game.Content.Load<Texture2D>(@"Images\battery_background"),
                        position, new Point(137, 289), 0, new Point(1, 1), Vector2.Zero, null, 1, game, bot, body, top);
                    sprite.Scale = 0.5f;
                    break;
            }
        }
    }
}
